import func from './func'
const storage  = {}

storage.setLocalStorage = (key, obj)=>{
    localStorage.setItem(key, JSON.stringify(obj));
}

storage.getLocalStorage =(key)=>{
    const result = localStorage.getItem(key);
    if (result != null && func.isJsonStr(result)) {
        return JSON.parse(localStorage.getItem(key));
    } else {
        return result || "";
    }
}
export default storage
